package com.rc.evcharger.service.rc;

import com.rc.evcharger.mapper.rc.RcMemberFlagMapper;
import com.rc.evcharger.model.member.MemberInfo;
import com.rc.evcharger.model.rc.RcMemberFlag;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class RcMemberFlagServiceImpl implements RcMemberFlagService {
    @Autowired
    private RcMemberFlagMapper rcMemberFlagMapper;

    @Autowired
    private RcMemberLevelSettingService rcMemberLevelSettingService;

    @Autowired
    private RcEnterpriseLevelSettingService rcEnterpriseLevelSettingService;
    @Autowired
    private RcChannelLevelSettingService rcChannelLevelSettingService;

    @Autowired
    private RcMemberGainRecordService rcMemberGainRecordService;

    @Autowired
    private RcEnterpriseGainRecordService rcEnterpriseGainRecordService;

    @Autowired
    private RcChannelGainRecordService rcChannelGainRecordService;

    @Autowired
    private RcMemberGainGradeRecordService rcMemberGainGradeRecordService;

    @Autowired
    private RcEnterpriseGainGradeRecordService rcEnterpriseGainGradeRecordService;

    @Autowired
    private RcOperatorService rcOperatorService;

    @Autowired
    private RcChannelGainSettingService rcChannelGainSettingService;

    @Autowired
    private RcEnterpriseGainSettingService rcEnterpriseGainSettingService;

    @Autowired
    private RcEnterpriseGainGradeSettingService rcEnterpriseGainGradeSettingService;

    @Autowired
    private RcMemberGainSettingService rcMemberGainSettingService;

    @Autowired
    private RcMemberGainGradeSettingService rcMemberGainGradeSettingService;

    @Override
    public RcMemberFlagMapper getMapper() {
        return rcMemberFlagMapper;
    }

    @Override
    public void inSertByRegister(MemberInfo member) {
        RcMemberFlag rcMemberFlag = new RcMemberFlag();
        BeanUtils.copyProperties(member, rcMemberFlag);
        rcMemberFlag.setCreatedTime(new Date());
        rcMemberFlag.setLastUpdatedTime(new Date());
        rcMemberFlagMapper.insertSelective(rcMemberFlag);
    }

}
